<extend name="Index::index"/>
<block name="table">
    <div class="layout-content">

        <div class="page-title">广告管理</div>

        <div class="content-top">
            <ul class="top-nav">
                <li class="active"><span>修改广告</span></li>
            </ul>
            <div class="clearfix"></div>
        </div>
        <!--content-main start-->
        <div class="container-fluid content-main">
            <div class="row">
                <div class="col-md-12">

                    <div id="tsk" class="ui-tips bg-info" style="display:none">
                        <span class="icon glyphicon glyphicon-info-sign"></span> <span
                            id="ts">提示信息提示信息提示信息提示信息提示信息提示信息。</span>
                    </div>

                    <form class="col-md-offset-3 form-horizontal"  action="{:U('Addver/updated',['id'=>$data['id'] ,'key'=>22])}" method="post" enctype="multipart/form-data" >

                        <div class="form-group">
                            <label class="col-sm-2 control-label" >广告名</label>
                            <div class="col-sm-5">
                                <input type="text" name="name" class="form-control" value="{$data['name']}"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label" >广告链接</label>
                            <div class="col-sm-5">
                                <input type="text" name="url" class="form-control" value="{$data['url']}"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">广告原图</label>
                            <div class="col-sm-8">
                                <img src="__PUBLIC__/upload/{$data['picture']}" width="130" height="60" alt=""/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">广告图</label>
                            <div class="col-sm-8">
                                <input type="file" name="pic">
                                <span class="help-block">只能上传 <b>"jpg","png","jpeg"</b> 格式的图片</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">广告状态</label>
                            <div class="col-sm-5">
                                <select class="form-control js_status" name="status"  >
                                    <option value="10" id="4">可用</option>
                                    <option value="30" id="5">禁用</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-8">
                                <button  style="margin-left: 90px;width: 150px" type="submit" class="btn btn-default">保存</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <!--content-main end-->
    </div>
    <script>
        $(function(){

            var b = $('.js_status').find($('#'+{$data['status']}+3));
            b.attr('selected',true);
        })
    </script>
</block>